#ifndef _ENC_DEC_CONFIG
#define _ENC_DEC_CONFIG

#include <string>
#include <vector>


class config
{
public:
	 config(const char* _filename);	


	enum
	{
		FIRST_AS_PUNCT, 
		MIN_DISTR_VALUE,
		MAX_DISTR_VALUE,
		MAX_TOKEN_LEN,
		CIPHER_FILE,
		KEY_FILE,
		IV_FILE,
		SEED_FILE,
		ALLOW_PUNCT,
		FORBID_PUNCT,
    VOLUME_MAP_FILE,
    EXPORT_FILENAME,
		CONFIG_TOT_OPTS
	} ;

	static const char* CONFIG_OPTS[CONFIG_TOT_OPTS][2];
	
	enum
	{
		MAX_INNER_TOKEN_LEN,
		INNER_TOKEN_MIN_DISTR_VALUE,
		INNER_TOKEN_MAX_DISTR_VALUE,
		REGEX,
		INGDIRECT_CONFIG_FILE,
		HIDDEN_TOT_OPTS
	} ;

	static const char* HIDDEN_OPTS[HIDDEN_TOT_OPTS][2];

	static const char* DEFAULT_CIPHER_FILE;
	static const char* DEFAULT_KEY_FILE;
	static const char* DEFAULT_IV_FILE;
	static const char* DEFAULT_SEED_FILE;
	static const char* DEFAULT_REGEX;
  static const char* DEFAULT_VOLUME_MAP_FILE;
  static const char* DEFAULT_EXPORT_FILENAME;

	
	unsigned short const& get_min_distr_value() const;
	unsigned short const& get_max_distr_value() const;
	unsigned short const& get_max_inner_token_len() const;
	unsigned short const& get_max_token_len() const;
	unsigned short const& get_inner_token_min_distr_value() const;
	unsigned short const& get_inner_token_max_distr_value() const;

	bool get_first_char_as_punct();	

	//bool get_even();

	std::string const& get_allowed_punctuation() const;
	std::string const& get_forbidden_punctuation() const;
	//const std::vector< unsigned short> get_substring_indices();

	std::string const& get_cipher_file();
	std::string const& get_key_file();
	std::string const& get_iv_file();
	std::string const& get_seed_file();
  std::string const& get_volume_map_filename() const;
   
	//const std::string get_token();
	std::string const& get_regex() const;	
	std::string const& get_export_filename() const;
	std::string const& get_keypad_config_filename() const;
  std::string const& get_config_filename() const;

	config& operator=(config const& _cfg);	
	
	friend std::ostream& operator << (std::ostream& ost, const config & c);

  static std::string const get_env_var(std::string const& key);
	
private:

	void init(const char* _filename);

	bool first_char_as_punct;

	unsigned short min_distr_value, 
			max_distr_value, 
			max_inner_token_len,
			max_token_len,
			inner_token_min_distr_value, 
			inner_token_max_distr_value;

	std::string _allowed_punctuation;
    	std::string _forbidden_punctuation;

	//std::vector< unsigned short> _substring_indices;

	std::string _cipher_file;
	std::string _key_file;
	std::string _iv_file;
	std::string _seed_file;
	//std::string _token;
	std::string _regex;	
	std::string _export_filename;
	std::string _config_filename;
	std::string _ingdirect_conffile;
   
  std::string _volume_map_file;

};


#endif

